package com.atguigu05._super.exer3;

/**
 * @author NoobMaster69  * @date 2024/5/30 0030 星期四 15:12
 */
public class Account {
    private String id;
    private double balance;
    private double annualInterestRate;

    public double getMonthlyInterest(){
        return (annualInterestRate / 12) / 100;
    }
    public void withdraw(double amount){
        if(amount >= balance){
            System.out.println("余额不足");
            System.out.println("你的账户余额为：" + balance);
        }else{
            System.out.println("你的账号余额为:" + (balance - amount));
            System.out.println("月利率" + getMonthlyInterest());
        }
    }
    public void deposit(double amount){

    }

    public Account() {
    }

    public Account(String id, double balance, double annualInterestRate) {
        this.id = id;
        this.balance = balance;
        this.annualInterestRate = annualInterestRate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnualInterestRate() {
        return annualInterestRate;
    }

    public void setAnnualInterestRate(double annualInterestRate) {
        this.annualInterestRate = annualInterestRate;
    }
}
